package cn.itcast.travel.web.servlet.admin;

import cn.itcast.travel.service.AdminService;
import cn.itcast.travel.service.impl.AdminServiceImpl;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "ALLusers", value = "/ALLusers")
public class ALLusers extends HttpServlet {
    AdminService service=new AdminServiceImpl();
    //获取所有用户
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ObjectMapper ob=new ObjectMapper();
        ob.writeValue(response.getWriter(),service.getalluser());
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
